

# for Ethiopia 1995

gdppc <- seq(1,25, length.out=75)
ideal <- seq(-.15, .01, length.out=75)

Z <- expand.grid(gdppc, ideal)

uI3 <- -.5896786
uV3 <- .0446082
uV2 <- -.5748826

mea <- pnorm((uI3+ .46167075*Z[,2] + .10793546*Z[,1])/sqrt(2))
voteout <- pnorm((mea*(uV3 -.02568935*Z[,1]) +(1-mea)*(uV2 + 2.3175709*Z[,2]))/sqrt(2))


Z <- cbind(Z, voteout)

zmat <- matrix(voteout, length(gdppc), length(ideal))

persp(zmat, theta=330, phi=0, xlab="GDP per capita", ylab="Ideal Point Diff.", zlab="Replacement Probability", ticktype="simple")

alo <- persp(gdppc, ideal, zmat, theta=330, phi=0, xlab="GDP per capita", ylab="Ideal Point Diff.", zlab="Replacement Probability", ticktype="simple")

